<?php
/**
 * @Author: Marte
 * @Date:   2017-08-20 12:44:25
 * @Last Modified by:   Marte
 * @Last Modified time: 2017-08-20 13:41:04
 */
session_start();
header('Content-Type:text/html;charset=utf-8');
require '../data/config_connect.php';
if(!isset($_POST["submit"])){
      exit('非法访问!');
  }
$_noticetitle=$_POST['title'];
$_name=$_SESSION['username'];
$_conment=$_POST['conment'];


$_sqll=' insert into notice (noticetitle,noticename,conment,time) values ("'.$_noticetitle.'","'.$_name.'","'.$_conment.'",now())';
if($_result=$_mysql->query($_sqll))
{
    echo "<script>alert('发布成功！');location='admin_index.php?type=2';</script>";
}else{
    echo "<script>alert('发布失败，请重新发布');window.history.back();</script>";
}















?>